package ti;

import java.awt.*;
import java.util.Arrays;

public class Test {
    public void compare(String s,String t){
        if(s.length() == t.length()){
            for (int i = 0; i < s.length()-1; i++) {
                String[] strs1 = s.split("");
                String[] strs2 = t.split("");
                for (int n = 0; n < s.length()-1; n++) {
                    for (int m = 0; m < s.length()-1; m++) {
                        while (strs1[n].equals(strs2[m]) ){
                            int sum1 = 0;
                            int sum2 = 0;
                            for (int a = 0; a < s.length()-1; a++) {
                                if(strs1[a] != strs1[n]) {
                                    strs1[sum1] = strs1[a];
                                    sum1++;
                                }
                            }
                            for (int a = 0; a < s.length()-1; a++) {
                                if(strs2[a] != strs2[n]) {
                                    strs2[sum2] = strs2[a];
                                    sum2++;
                                }
                            }
                            System.out.println(Arrays.toString(strs1)+" "+Arrays.toString(strs2));
                        }
                    }

                }

            }
        }
    }
}

